package com.ysh.springdemo;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Arrays;
import java.util.List;

@RestController
@RequestMapping("/Request")
public class RequestController {
    @RequestMapping("/r1")
    public String r1(String keyWord){
        return "接受参数: "+keyWord;
    }
    @RequestMapping("/r2")
    public String r2(String userName,String passWord){
        return "接受参数： " + "userName : " + userName + ",passWord : " + passWord;
    }
    @RequestMapping("/r3")
    public String r3(UserInfo userInfo){
        return "接受参数 : "+userInfo.toString();
    }
    @RequestMapping("/r4")
    public String r4(int[] arr){
        return "接受参数："+ Arrays.toString(arr);
    }
    @RequestMapping("/r5")
    public String r5(@RequestParam List<Integer> list){
        return "接受参数："+list;
    }
}
